package main

import (
	"begouser/config"
	"begouser/router"
	"begouser/services"
	"log"

	"github.com/astaxie/beego"
	// "github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

func main() {

	router.RegisterRouters()

	// http.ListenAndServe(":19999", nil)

	config.InitUserOrmer()
	if user := services.GetUserByName("admin"); user == nil {
		log.Println("创建管理员账号")
		services.AddUser("admin", "123456", "长沙", false)

	}
	beego.Run(":80")
}
